home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / ttedit / textedit.frm < prev    next >
Text File  |  1995-01-04  |  3KB  |  115 lines

  1. VERSION 2.00
  2. Begin Form frmTextEdit 
  3.    AutoRedraw      =   -1  'True
  4.    ClientHeight    =   2055
  5.    ClientLeft      =   3600
  6.    ClientTop       =   3600
  7.    ClientWidth     =   3825
  8.    Height          =   2460
  9.    Icon            =   TEXTEDIT.FRX:0000
  10.    Left            =   3540
  11.    MDIChild        =   -1  'True
  12.    ScaleHeight     =   2055
  13.    ScaleWidth      =   3825
  14.    Top             =   3255
  15.    Width           =   3945
  16.    Begin TextBox txtWordWrap 
  17.       FontBold        =   0   'False
  18.       FontItalic      =   0   'False
  19.       FontName        =   "Fixedsys"
  20.       FontSize        =   9
  21.       FontStrikethru  =   0   'False
  22.       FontUnderline   =   0   'False
  23.       Height          =   615
  24.       HideSelection   =   0   'False
  25.       Left            =   0
  26.       MultiLine       =   -1  'True
  27.       ScrollBars      =   2  'Vertical
  28.       TabIndex        =   1
  29.       Top             =   0
  30.       Visible         =   0   'False
  31.       Width           =   3735
  32.    End
  33.    Begin TextBox txtTextEdit 
  34.       FontBold        =   0   'False
  35.       FontItalic      =   0   'False
  36.       FontName        =   "Fixedsys"
  37.       FontSize        =   9
  38.       FontStrikethru  =   0   'False
  39.       FontUnderline   =   0   'False
  40.       Height          =   1335
  41.       HideSelection   =   0   'False
  42.       Left            =   0
  43.       MultiLine       =   -1  'True
  44.       ScrollBars      =   3  'Both
  45.       TabIndex        =   0
  46.       Top             =   0
  47.       Width           =   3135
  48.    End
  49. End
  50. Option Explicit
  51.  
  52. '
  53. ' Keep the menu in synch with the form
  54. '
  55. Sub Form_Activate ()
  56.   MDI.mnu_Edit_WordWrap.Checked = txtWordWrap.Visible
  57.   Call EditMenu(True)
  58. End Sub
  59.  
  60. Sub Form_Deactivate ()
  61.     Call EditMenu(False)
  62. End Sub
  63.  
  64. '
  65. ' Make the textboxes handle 64k instead on 32k
  66. '
  67. Sub Form_Load ()
  68.     If sendMessage(txtTextEdit.hWnd, EM_LIMITTEXT, 0, ByVal 0&) Then
  69.     End If
  70.     If sendMessage(txtWordWrap.hWnd, EM_LIMITTEXT, 0, ByVal 0&) Then
  71.     End If
  72. End Sub
  73.  
  74. '
  75. ' Check to see whether the text has changed
  76. '
  77. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  78.    Dim C As Control
  79.    Dim X As Integer
  80.    Set C = Me.ActiveControl
  81.    If sendMessage(C.hWnd, EM_GETMODIFY, 0, ByVal 0&) Then
  82.       X = MsgBox("The text in " & Caption & " has changed." & Chr(10) & Chr(10) & Chr(13) & "Do you wish to save the changes ?", MB_YESNOCANCEL + MB_ICONEXCLAMATION)
  83.    End If
  84.    Select Case X
  85.      Case IDYES
  86.         Call FileSave
  87.      Case IDCANCEL
  88.         Cancel = True
  89.    End Select
  90. End Sub
  91.  
  92. '
  93. ' Make the text boxes fill the form
  94. '
  95. Sub Form_Resize ()
  96.     txtTextEdit.Width = Scalewidth
  97.     txtTextEdit.Height = ScaleHeight
  98.     txtWordWrap.Width = Scalewidth
  99.     txtWordWrap.Height = ScaleHeight
  100. End Sub
  101.  
  102. Sub Form_Unload (Cancel As Integer)
  103.     Call Form_Deactivate
  104.     Call DeleteForm(Me)   ' Call the cleanup handler to keep track of each instance
  105. End Sub
  106.  
  107. Sub txtTextEdit_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  108.     If Button = MK_RBUTTON Then PopupMenu MDI.mnu_Edit, 0, X, Y
  109. End Sub
  110.  
  111. Sub txtWordWrap_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  112.     If Button = MK_RBUTTON Then PopupMenu MDI.mnu_Edit, 0, X, Y
  113. End Sub
  114.  
  115.